package photo.managerv0;

import java.util.ArrayList;
import java.util.List;
import java.io.*;
public class FindFile {
	public List<String> findDir(String path){
		File f=new File(path);
		List<String> list=new ArrayList();
		File[] flist=f.listFiles();
		for(int i=0;i<flist.length;i++){
			if(flist[i].isDirectory()){
				list.add(flist[i].getAbsolutePath());
			}
		}
		return list;
	}
	public List<String> findPic(String path){
		File f=new File(path);
		List<String> list=new ArrayList();
		File[] flist=f.listFiles();
		for(int i=0;i<flist.length;i++){
			if(flist[i].isFile()&&flist[i].getName().endsWith(".jpg")){
				list.add(flist[i].getAbsolutePath());
			}
		}
		return list;
	}
}
